<script src="<?php echo base_url("assets/js/jquery.slugify.js")?>"></script>
<style>
	label{font-weight:bold}
	.btn-back{margin-left:15px;}
</style>
<script>
$().ready(function(){
	generate_slug = function(input_form, output_form, space_character, disallow_dashes){
		space_character = space_character || '-';
		$(input_form).slugify({ slug: output_form, type: space_character });
	} 
	$("input[name='title']").on("keyup",function(e) {
		generate_slug($(this), $('#slug'));
	});
	$("#delete_img").click(function(){
		if(confirm("Bạn có thật sự muốn xóa hình này")){
			return true;	
		}
		return false;
	});
	$(".btn-back").click(function(){
		window.location = "<?php echo site_url("admin/blogs_category")?>";
		return false;
	});
}); 
</script>
<div class="page-header">
	<h1>Blogs <?php echo empty($model["title"])?"":$model["title"]?></h1>
</div>
<?php echo form_open_multipart($this->config->item('admin_folder').'/blogs_category/edit/'.$model["id"]); ?>
<div class="tabbable">
    <div class="tab-content">
    	<div class="form-actions"><button class="btn btn-primary">Lưu</button> <button class="btn btn-back">Trở về</button></div>
        <fieldset>
            <label for="name">Tiêu đề tin</label>
            <?php echo form_input(array("name"=>"title","value"=>$model["title"],"class"=>"span12","id"=>"title")) ?>
            <label for="name">Liên kết tĩnh</label>
             <?php echo form_input(array("name"=>"slug","value"=>$model["slug"],"class"=>"span12","id"=>"slug","readonly"=>"readonly")) ?>
            <label for="name">Số thứ tự hiển thị</label>
             <?php echo form_input(array("name"=>"ordering","value"=>$model["ordering"],"class"=>"span12","id"=>"ordering")) ?>
             <label for="status"> Trạng thái</label>
             <?php echo form_dropdown("status",array(1=>"bật",2=>"tắt"),$model["status"],"class='span4'")?>
        </fieldset>

        <div class="form-actions"><button class="btn btn-primary">Lưu</button> <button class="btn btn-back">Trở về</button></div>
    </div>
</div>